/* Docsy-delta full file override: we're not tracking changes to the Docsy file of the same name. */
// cSpell:ignore cncf docsy otca

@import 'registry';
@import 'tabs';
@import 'external_link';
@import 'td/code-dark';
@import '_page_no_left_sidebar';

.td-home {
  .otel-logo {
    margin-top: 2rem;
    margin-bottom: 3rem;
    max-height: 12rem;
  }

  .td-box--white .container blockquote {
    font-size: smaller;
  }
}

.l-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
  margin-bottom: 1rem;

  > ul {
    list-style: none;
    margin: 0;
    padding: 0;

    > li {
      display: inline;
      > a {
        @extend .btn;
        margin: 0.25rem;

        &:hover {
          text-decoration: none;
        }
      }
    }
  }
}

.l-get-started-buttons {
  @extend .l-buttons;

  > ul > li > a /*, > p > a*/ {
    @extend .btn-lg;
    @extend .btn-secondary;
  }
}

.l-primary-buttons {
  @extend .l-buttons;

  > ul > li > a {
    @extend .btn-lg;
    @extend .btn-primary;
  }
}

//override the button classes for the Status page only
.l-status-primary {
  @extend .l-buttons;
  justify-content: left;

  > ul > li > a /*, > p > a*/ {
    @extend .btn-lg;
    @extend .btn-primary;
    padding: 20px;
    border-radius: 0;
    min-width: 220px;
  }
}

.l-status-secondary {
  @extend .l-buttons;
  justify-content: left;

  > ul > li > a /*, > p > a*/ {
    @extend .btn-lg;
    @extend .btn-secondary;
    padding: 20px;
    border-radius: 0;
    min-width: 150px;
    color: #2f4f4f;
  }
}

.td-navbar {
  .navbar-brand {
    @include media-breakpoint-up(md) {
      padding: 0;
    }
    svg {
      height: 48px;
    }
    .navbar-brand__name {
      display: none;
    }
  }
}

// Adjust the spacing of page-meta and page-TOC (https://github.com/open-telemetry/opentelemetry.io/pull/354)
// TODO: upstream
.td-toc #TableOfContents {
  padding-top: 1rem;
}

.td-home {
  .cncf {
    text-align: center;

    p {
      font-size: 1.2rem;
      margin-bottom: 0;
    }

    img {
      width: 20rem;
      padding-top: 1rem;
      max-width: 80%;
    }

    a {
      color: white;
      &.external-link:after {
        display: none;
      }
    }
  }
}

.o-banner {
  @include media-breakpoint-up(md) {
    width: 100%;
    position: fixed;
    margin-left: -15px;
    z-index: 31;
    top: 4rem;
  }

  background: var(--td-pre-bg);
  color: var(--bs-body-color);
  text-align: center;

  & p {
    padding: 0.5rem;
    margin-bottom: initial;
  }
}

.td-page-meta__child {
  display: none !important;
}

.otel-docs-spec {
  .td-page-meta__edit {
    display: none !important;
  }
}

// Contribution section in community page
.community-contribution {
  text-align: center;

  & > p {
    font-size: $h3-font-size;
    font-weight: $headings-font-weight;
    line-height: $headings-line-height;
    margin-bottom: $headings-margin-bottom;
  }
}

.config-option {
  padding-inline-start: 1.5em;

  .label {
    font-weight: bold;
  }

  details {
    background-color: var(--bs-tertiary-bg);
    margin-bottom: 0.5em;

    summary {
      display: block;
      &::-webkit-details-marker {
        display: none;
      }

      &::after {
        color: $secondary;
        @extend .fas;
        content: fa-content($nbsp + $fa-var-plus-circle);
      }
    }

    &[open] summary::after {
      @extend .fas;
      content: fa-content($nbsp + $fa-var-minus-circle);
    }
  }
}

.otel-mermaid-max-width pre.mermaid {
  max-width: inherit;
}

.td-content img:not(.img-initial) {
  display: block;
  border: $border-width solid $border-color;
  margin-bottom: $paragraph-margin-bottom;
  @extend .td-max-width-on-larger-screens;
}

.td-blog.otel-with-contributions-from {
  .td-content {
    .td-byline {
      margin: 0 !important;
    }
    .article-meta {
      margin: 0;
    }
    p:first-of-type {
      @extend .small;
      opacity: 0.65;
      padding-top: 0.2rem;
      margin-bottom: 1.5rem;
    }
  }
}

// Registry

.td-section.registry {
  .td-outer {
    height: auto;
  }

  .registry-entry {
    display: flex;
    align-items: flex-start;
    padding-bottom: 0.5rem;

    .h5 {
      margin-bottom: 0.2rem;
    }

    &-body {
      flex: 1;
    }
  }
}

body.td-page--draft .td-content {
  position: relative;

  &::after {
    content: 'Draft';
    position: absolute;
    top: 10vw;
    left: 50%;
    transform: translate(-50%, 0) rotate(-45deg);
    color: rgba(255, 0, 0, 0.3);
    font-size: 18vw;
    z-index: 9999;
    pointer-events: none;
    text-transform: uppercase;
    font-weight: bold;
    text-align: center;
    max-width: max-content;
  }
}

details {
  margin-bottom: $paragraph-margin-bottom;
}

.ot-integration-badge {
  @extend .btn;
  @extend .shadow;

  border-radius: 0 !important;

  position: relative;
  float: right;
  transform: rotate(6deg);
  background: hsl(60, 100%, 60%);
  border-color: hsl(60, 100%, 60%);
  padding: 1rem;
  margin: 0 1rem 1rem 1rem;

  &__text {
    font-weight: $font-weight-semibold;
  }

  &__info {
    @extend .text-warning;
    @extend .translate-middle;

    position: absolute;
    top: 0;
    left: 100%;
  }

  &:hover {
    background: hsl(60, 100%, 60%);
    transform: rotate(4deg);
    transition: transform 0.2s linear;
  }
}

// Workaround for iOS and macOS Safari 17+. For details see:
// https://github.com/open-telemetry/opentelemetry.io/issues/3538

.td-content .highlight > pre {
  > .click-to-copy,
  > code {
    overflow-y: auto;
  }
}

// Google translate select / dropdown

.goog-te-gadget {
  // cSpell:ignore goog
  padding-top: 1rem;
  margin-bottom: -0.5rem;

  @include media-breakpoint-up(md) {
    padding-left: 0.6rem;
  }
}

.ot-training {
  @extend .td-no-left-sidebar;
  $card-padding: 2rem;

  .badge--otca {
    margin-top: map-get($spacers, 4) !important;
    img {
      border-style: none !important;
      display: initial;
      max-width: 244px;
    }
    @include media-breakpoint-up(md) {
      padding-left: $card-padding;
    }

    @include media-breakpoint-down(md) {
      text-align: center;
    }
  }

  .card--course-wrapper {
    @include media-breakpoint-up(md) {
      padding-left: $card-padding;
    }
  }

  .card--course {
    margin-top: map-get($spacers, 5) !important;
    margin-bottom: map-get($spacers, 5) !important;

    @include media-breakpoint-down(md) {
      margin-left: auto !important;
      margin-right: auto !important;
    }

    img {
      padding-bottom: 2.6rem;
    }
  }
}

// TODO: upstream to Docsy

.hk-no-external-icon {
  a.external-link:after {
    display: none !important;
  }
}
